
package com.yanboo.modules.quartz.domain;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import com.yanboo.common.base.BaseEntity;
import jakarta.persistence.*;
import jakarta.validation.constraints.NotBlank;
import java.io.Serializable;

@Getter
@Setter
@Entity
@Table(name = "sys_quartz_job")
public class QuartzJob extends BaseEntity implements Serializable {

    public static final String JOB_KEY = "JOB_KEY";

    @Transient
    @Schema(description = "用于子任务唯一标识", hidden = true)
    private String uuid;

    @Schema(description = "定时器名称")
    private String jobName;

    @NotBlank
    @Schema(description = "Bean名称")
    private String beanName;

    @NotBlank
    @Schema(description = "方法名称")
    private String methodName;

    @Schema(description = "参数")
    private String params;

    @NotBlank
    @Schema(description = "cron表达式")
    private String cronExpression;

    @Schema(description = "状态，暂时或启动")
    private Boolean isPause = false;

    @Schema(description = "负责人")
    private String personInCharge;

    @Schema(description = "报警邮箱")
    private String email;

    @Schema(description = "子任务")
    private String subTask;

    @Schema(description = "失败后暂停")
    private Boolean pauseAfterFailure;

    @NotBlank
    @Schema(description = "备注")
    private String description;
}